package util;

import java.util.Date;

import utils.DateUtil;

public class ParameterUtil {

	public static Double[] numberCombin(Double doubleTop, Double doubleEnd) {
		if (doubleTop == null && doubleEnd == null) {
			return null;
		} else if (doubleTop == null && doubleEnd != null) {
			return new Double[] { Double.MIN_VALUE, doubleEnd };
		} else if (doubleTop != null && doubleEnd == null) {
			return new Double[] { doubleTop, Double.MAX_VALUE };
		} else {
			return new Double[] { doubleTop, doubleEnd };
		}
	}

	public static Date[] dateCombin(Date dateTop, Date dateEnd) {
		if (dateTop == null && dateEnd == null) {
			return null;
		}
		dateTop = DateUtil.topOfDay(dateTop);
		dateEnd = DateUtil.topOfDay(DateUtil.intervalDay(dateEnd,1));
		return new Date[] { dateTop, dateEnd };
	}
	
public static void main(String[] args) {
	
	dateCombin(new Date(0L), new Date(0L));
	
}
}
